package com.jz;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * @ClassName : OrderApplication  //类名
 * @Description :   //描述
 * @Author : 岚氓  //作者
 * @Date: 2020-11-02 19:12  //时间
 * @Version 1.0
 */
@SpringBootApplication
@MapperScan("com.jz.mapper")
@EnableFeignClients//开启feign的注解
@EnableCircuitBreaker
@EnableHystrixDashboard
public class OrderApplication {
    public static void main(String[] args) {
        SpringApplication.run(OrderApplication.class,args);
    }

    @Bean
    @LoadBalanced  //负载均衡 Ribbon 基于Restful完成的负载均衡
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }
}
